﻿using HuiZe.education.Resource.Controls;
using HuiZe.education.ViewModel;
using System.Windows;
using System.Windows.Controls;

namespace HuiZe.education.View
{
    /// <summary>
    /// NewGroupView.xaml 的交互逻辑
    /// </summary>
    public partial class EditGroupView : HuiZeWindow
    {
        public MySpaceViewModel mySpaceViewModel = null;

        public EditGroupView()
        {
            InitializeComponent();
            this.MaxHeight = System.Windows.Forms.Screen.PrimaryScreen.WorkingArea.Height + 10;
            this.MaxWidth = System.Windows.Forms.Screen.PrimaryScreen.WorkingArea.Width + 10;
            Loaded += StudentView_Loaded;
        }
        public int groupId = 0;
        public string groupName { get; set; }

        private void YCButton_Click(object sender, RoutedEventArgs e)
        {
            Close();
        }
        void StudentView_Loaded(object sender, RoutedEventArgs e)
        {
            mySpaceViewModel = DataContext as MySpaceViewModel;
            GroupName.Text = groupName;
            //studentView.LoginView = this;
            //loginViewModel.NavChanged("AccountLoginView");
        }
        void YCButton_Click_1(object sender, RoutedEventArgs e)
        {
            bool _success = mySpaceViewModel.editGroup(groupId, GroupName.Text);
            if (_success)
                Close();
        }
    }
}
